export const setItem=(key,value)=>{
    if(typeof value==="object")
    {
        value=JSON.stringify(value);
    }
    window.localStorage.setItem(key,value);

}
export const getItem=(key)=>{
    const data=window.localStorage.getItem(key);
    console.log("storage.js getitem",data)
    try
    {
        console.log("storage on lin 14",data);
      return JSON.parse(data);
    }
    catch(e)
    {
        console.log("storage on lin 18");
         return data;
    }
}

export const removeItem=(key)=>{
    window.localStorage.removeItem(key);
}